<!DOCTYPE html>
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<!--<base href="http://localhost:8080/">-->
		<base href=".">

		<title>主页</title>
		<meta name="robots" content="noindex,nofllow">
		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">

		<!--<base href="http://localhost:8080/">-->
		<base href=".">

		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta name="viewport" content="width=device-width, initial-scale=1,user-scalable=no">
		<link rel="icon" href="favicon.ico" mce_href="favicon.ico" type="image/x-icon">
		<link rel="shortcut icon" href="favicon.ico" mce_href="favicon.ico" type="image/x-icon">

		<script type="text/javascript" src="./js/jquery1113.js"></script>
		<script src="js/mui.min.js"></script>
		<link href="css/mui.min.css" rel="stylesheet" />


		<script type="text/javascript" src="./js/jquery1113.js"></script>
		<link href="./css/bootstrap.min.css" rel="stylesheet">
		<link href="./css/bootstrap-theme.min.css" rel="stylesheet">
		<script src="./js/bootstrap.min.js"></script>
		<script src="./js/data.js"></script>
		<link href="./css/web-base.css" rel="stylesheet">
		<script type="text/javascript">

		</script>
		<script src="./js/base64.js"></script>
		<script src="./js/md5.js"></script>
		<script src="./js/encode.provider.js"></script>
	</head>
	<body>
		<script type="text/javascript">
			(function() {
				mui.init({
					swipeBack: true //启用右滑关闭功能
				});
				mui.plusReady(function() {
					function checkUrl(appendUrl) {
						return serverUrl + appendUrl;
					}

					$('#alertMessageErrorId').hide();
					$('#loginButtonId')
						.bind(
							'click',
							function() {
								plus.webview.open('index.html', 'new', {}, 'slide-in-right', 200);
								return;
								if ($('#loginNameId').val() &&
									$('#loginPassWId').val()) {
									//$('#loginUrlId').val(document.referrer);
									$('#loginButtonId').addClass("disabled");
									$('#loginButtonId').text("提交中...");
									var scret_password = (AuthKeyProvider.encode(
										'SAFE', $(
											'#loginPassWId').val()));
									$('#realPasswordId').val(scret_password);
									formSubmit();
								} else {
									$('#alertMessageErrorId').show();
									$('#romovealertMessageErrorId').hide();
									$('#alertMessageErrorId')
										.html(
											'请输入用户名/密码');
								}
							});
					$('#loginNameId').keydown(function(e) {
						if (e.keyCode == 13) {
							//$('#loginUrlId').val(window.location.href);
							$('#loginButtonId').click();
						}
					});
					$('#loginPassWId').keydown(function(e) {
						if (e.keyCode == 13) {
							//$('#loginUrlId').val(window.location.href);
							$('#loginButtonId').click();
						}
					});
					$('#checkcodeId').keydown(function(e) {
						if (e.keyCode == 13) {
							//$('#loginUrlId').val(window.location.href);
							$('#loginButtonId').click();
						}
					});

					// $('#checkcodeimgId').bind("click",function(e) {
					// $('#checkcodeimgId').attr("src",checkUrl("webfile/Pubcheckcode.do?time="+ new Date().getTime()));
					// });

					function formSubmit() {
						var formData = $("#loginFormId").serializeArray(); // 获取表单数据并转换为数组

						var jsonObject = {};
						var paramStr = '';
						$.each(formData, function(index, field) {
							jsonObject[field.name] = field.value;
							if (index == 0) {
								paramStr += ('?' + field.name + "=" + field.value);
							} else {
								paramStr += ('&' + field.name + "=" + field.value);
							}
						});

						xhr = new plus.net.XMLHttpRequest();
						xhr.onreadystatechange = function() {
							switch (xhr.readyState) {
								case 0:
									console.log("xhr请求已初始化");
									break;
								case 1:
									console.log("xhr请求已打开");
									break;
								case 2:
									console.log("xhr请求已发送");
									console.log(xhr);
									break;
								case 3:
									console.log("xhr请求已响应");
									break;
								case 4:
									if (xhr.status == 200) {
										console.log("xhr请求成功：" + xhr.responseText);
										var data = JSON.parse(xhr.responseText);
										if (data && data.result == 1) {
											window.location.href = serverUrl + "login/websubmit.html" + paramStr;
										} else {
											$('#loginButtonId').removeClass("disabled");
											$('#loginButtonId').text("登录");
											$('#alertMessageErrorId').show();
											$('#romovealertMessageErrorId').hide();
											if (data.message) {
												$('#alertMessageErrorId').html(data.message);
											} else {
												$('#alertMessageErrorId').html('系统错误，请稍后重试');
											}
										}

									} else {
										console.log("xhr请求失败：" + xhr.readyState);
									}
									break;
								default:
									break;
							}
						}
						xhr.open("POST", serverUrl + "reson/Pubwebsubmit.do");
						xhr.setRequestHeader("Content-Type", "application/json");
						console.log(JSON.stringify(jsonObject))
						xhr.send(JSON.stringify(jsonObject));

						// $.post(serverUrl+"reson/Pubwebsubmit.do", jsonObject, function(data) {
						// 	if (data && data.result == 1) {

						// 		window.location.href = serverUrl+"login/websubmit.html" + paramStr;
						// 	} else {
						// 		$('#loginButtonId').removeClass("disabled");
						// 		$('#loginButtonId').text("登录");
						// 		$('#alertMessageErrorId').show();
						// 		$('#romovealertMessageErrorId').hide();
						// 		if (data.message) {
						// 			$('#alertMessageErrorId').html(data.message);
						// 		} else {
						// 			$('#alertMessageErrorId').html('系统错误，请稍后重试');
						// 		}
						// 	}

						// }, 'JSON');
					}

				});
			})();
		</script>
		<div class="containerbox" style="margin-top: 100px;">
			<div class="container ">
				<div
					style="box-shadow: 0px 0px 50px 15px rgba(0, 0, 0, 0.1); margin: auto; border-radius: 6px 6px 6px 6px; max-width: 800px; border: 1px solid #e7e7e7; margin-top: 30px; margin-bottom: 100px; background-color: #fcfcfc;">
					<div class="panel-body" style="padding: 0px;">
						<div class="row">
							<div class="col-md-6" style="padding: 50px; padding-top: 10px; padding-bottom: 20px;">
								<h1 style="color: #666; font-size: 24px; font-weight: 700;">
									<img src="images/logo.png" width="64px" height="64px;">
									法治公主岭
								</h1>
								<hr>
								<form class="form-signin" role="form" id="loginFormId" action="" method="post">
									<div class="form-group">
										<label for="exampleInputEmail1"> 登录名 </label> <input type="text"
											class="form-control" placeholder="手机/邮箱/用户登录名" value=""
											style="margin-top: 4px;" id="loginNameId" name="name" required=""
											autofocus="">
									</div>
									<div class="form-group">
										<label for="exampleInputEmail1"> 登录密码 </label> <input type="password"
											class="form-control" placeholder="请录入密码" style="margin-top: 4px;"
											id="loginPassWId" required=""> <input name="password" type="hidden"
											id="realPasswordId">
									</div>
									<!-- <div class="form-group">
										<label for="exampleInputEmail1">验证码</label>
										<div class="input-group">
											<input type="text" class="form-control" placeholder="请录入验证码"
												id="checkcodeId" name="checkcode">
											<div class="input-group-addon" style="padding: 0px;">
												<img id="checkcodeimgId"
													style="cursor: pointer; height: 30px; width: 100px;"
													src="" />
											</div>
										</div>
									</div> -->
									<!-- <input type="hidden" name="url" id="loginUrlId"> -->
									<div>
										<button class="btn btn-danger text-left" id="loginButtonId"
											style="margin-top: 4px; width: 100%;" type="button">登录</button>
									</div>
								</form>
		
								<div class="text-center" id="alertMessageErrorId"
									style="margin: 4px; color: red; border-top: 1px dashed rgb(204, 204, 204); padding-top: 20px; display: none;">
								</div>
							</div>
							<div class="col-md-6 hidden-xs hidden-sm "
								style="border-left: 1px solid #e7e7e7; padding-left: 0px;">
								<div style="height: 450px; overflow: hidden; border-radius: 0px 6px 6px 0px;">
									<img alt="" height="450px" src="./img/colors.jpg">
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
		<div class="container-fluid " style="padding: 0px;">
			<div class="container-fluid" style="background-color: #f8fafc;">
				<div class="container">
					<div class="row">
						<div class="col-md-12">
							<div style="height: 100px; padding: 50px; text-align: center; color: #99a1a6;">
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</body>
</html>